Ext.define('wmf.view.home.header', {
    extend: 'Ext.container.Container',
    alias: 'widget.mainHeader',

    requires: [
    ],
    
    title: trans.home.title,
    height: 52,
    layout: {
        type: 'hbox',
        align: 'middle'
    },

    initComponent: function() {
        document.title = this.title;
        var menu = new Ext.menu.Menu({
                showSeparator: false,
                items: [{
                    text: '<div style="color:red">'+ logonName +',你好</div>'
                },{
                    text: trans.home.quit,
	                handler: function() {
	                	window.location.href = 'logoff.do';
	                }
                }]
            });

        this.items = [{
            xtype: 'component'
        },{
            xtype: 'component',
            style: {
            	color: '#ff0000',
            	fontSize: '18px',
            	padding: '0px 0px 0px 20px'
            },
            html: this.title,
            flex: 1
        },{
            xtype: 'component',
            itemId: 'menu',
            margin: '20pt 20pt',
            style: {
            	color: '#ff0000',
            	fontSize: '14px',
            	padding: '0px 20px 0px 20px'
            },
            html: trans.global.operation.menu,
            listeners: {
                click: function (e) {
                    menu.showBy(this);
                },
                element: 'el'
            }
        }];

        this.callParent();
    }
});